package huachenxing.mimi520.skin
{
	import com.cambright.mixpaint.Block;
	import com.cambright.mixpaint.Border;
	
	public class Panel extends Border
	{
		private var _title:Block;
		private var _content:Block;
		
		public function get title():Block
		{
			return _title;
		}
		
		public function get content():Block
		{
			return _content;
		}
		
		override protected function invoke():void
		{
			super.invoke();
			
			_title = new Block();
			_content = new Block();
			
			_title.height = 36;
			_title.color = 0x11243B;
			_content.y = _title.height;
			_content.color = 0xFFFFFF;
			
			addChild(_title);
			addChild(_content);
			
			width = 100;
			height = 100;
		}
		
		override public function dispose():void
		{
			removeChild(_title);
			removeChild(_content);
			
			_title.dispose();
			_content.dispose();
			
			_title = null;
			_content = null;
			
			super.dispose();
		}
		
		override protected function draw():void
		{
			super.draw();
			_title.width = width;
			_content.width = width;
			_content.height = height - _title.height;
		}
	}
}



